From 9aa4d24b91d345021efca2fc9739035de65fe686 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Sat, 6 Jul 2013 21:49:59 +0000 Subject: [PATCH] Fix crash on 'gpsbabel -x' --- gpsbabel/filter_vecs.cc | 6 ++++-- gpsbabel/testo.d/arc-project.test | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gpsbabel/filter_vecs.cc b/gpsbabel/filter_vecs.cc index 41971eb76..5a072e20e 100644 --- a/gpsbabel/filter_vecs.cc +++ b/gpsbabel/filter_vecs.cc @@ -24,6 +24,8 @@ #include "inifile.h" #include "gbversion.h" +#include + typedef struct { filter_vecs_t* vec; const char* name; @@ -156,14 +158,14 @@ find_filter_vec(char* const vecname, char** opts) { fl_vecs_t* vec = filter_vec_list; char* v = xstrdup(vecname); - char* svecname = strtok(v, ","); + QString svecname = QString(v).split(",")[0]; int found = 0; while (vec->vec) { arglist_t* ap; char* res; - if (case_ignore_strcmp(svecname, vec->name)) { + if (svecname.compare(vec->name, Qt::CaseInsensitive)) { vec++; continue; } diff --git a/gpsbabel/testo.d/arc-project.test b/gpsbabel/testo.d/arc-project.test index 2886ead5f..21408321f 100644 --- a/gpsbabel/testo.d/arc-project.test +++ b/gpsbabel/testo.d/arc-project.test @@ -15,3 +15,8 @@ compare ${REFERENCE}/arc-project2.gpx ${TMPDIR}/arc-project2.gpx # Test 3: trk & project options gpsbabel -i gpx -f ${REFERENCE}/arc-project.gpx -x arc,trk,project,distance=0.1K -o gpx -F ${TMPDIR}/arc-project3.gpx compare ${REFERENCE}/arc-project3.gpx ${TMPDIR}/arc-project3.gpx + +# Test 4: Verify that filter names aren't case sensistive. (Actually has +# nothing specific to arc...) +gpsbabel -i gpx -f ${REFERENCE}/arc-project.gpx -x ArC,trk,project,distance=0.1K -o gpx -F ${TMPDIR}/arc-project3.gpx +compare ${REFERENCE}/arc-project3.gpx ${TMPDIR}/arc-project3.gpx -- 2.30.2